'use strict';

import React from 'react';
import * as Constant from '../../constants/Constant'

require('styles/common/Header.css');

class HeaderComponent extends React.Component {
  constructor(props){
    super(props)
    this.showNewsPage=this.showNewsPage.bind(this);
    this.showTweetPage=this.showTweetPage.bind(this);
  }

  showNewsPage(){
    const {headerTabClick}=this.props;
    headerTabClick(Constant.PAGES.NEWS_LIST_PAGE);
  }

  showTweetPage(){
    const {headerTabClick}=this.props;
    headerTabClick(Constant.PAGES.TWEET_LIST_PAGE);
  }

  render() {

    return (
      <div className="header">
        	<div className="header-content">
        		<ul >
        			<li className="item"><a href="#" className="news" onClick={this.showNewsPage}>资讯</a></li>
        			<li className="item"><a href="#" className="tweet" onClick={this.showTweetPage}>动弹</a></li>
        		</ul>
        	</div>
        	
      </div>
    );
  }
}

HeaderComponent.displayName = 'CommonHeaderComponent';

// Uncomment properties you need

// HeaderComponent.propTypes = {
//   handleOnClick:React.PropTypes.func.isRequired
// };
// HeaderComponent.defaultProps = {};


export default HeaderComponent;
